package com.yunang.officialweb.service.impl;

import com.yunang.officialweb.entity.PageOfProject;
import com.yunang.officialweb.entity.Servicesproject;
import com.yunang.officialweb.mapper.ProjectMapper;
import com.yunang.officialweb.service.ProjectService;
import com.yunang.officialweb.service.TotalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProServicelmpl implements ProjectService {
    @Autowired
    private ProjectMapper projectMapper;
    @Autowired
    private TotalService totalService;
    @Override
    public List<Servicesproject> selectAll(){
        return projectMapper.selectAll();
    }
    @Override
    public PageOfProject selectPage(){
        PageOfProject pageOfProject=new PageOfProject();
        int id=3;
      // HomeServiceImpl homeService=new HomeServiceImpl();
      // pageOfProject.setViewDesc(homeService.getCompanyServices());
        pageOfProject.setViewDesc(totalService.selectById(id));
        pageOfProject.setServicesprojects(projectMapper.selectAll());
        return pageOfProject;
    }

    @Override
    public Boolean updateSerPro(Servicesproject servicesproject) {
        return projectMapper.updateSerPro(servicesproject);
    }
}
